package com.zhuhjay.eduservice.controller;

import com.zhuhjay.commonutils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

/**
 * @author ZhuHJay
 * @date 2022/9/6 13:54
 */
@Api(description = "登录控制器")
@RestController
@RequestMapping("/eduservice/user")

public class EduLoginController {

    @ApiOperation(value = "登录")
    @PostMapping("login")
    public R login() {
        return R.ok().data("token", "ZHUHJAY_LOGIN_TOKEN");
    }

    @ApiOperation(value = "获取用户信息")
    @GetMapping("info")
    public R info() {
        return R.ok().data("roles", "[admin]").data("name", "admin")
                .data("avatar", "https://online-teach-file.oss-cn-beijing.aliyuncs.com/teacher/2019/10/30/de47ee9b-7fec-43c5-8173-13c5f7f689b2.png");
    }

}
